import os 

imgs_dir = "charger/val"
imgs_list = os.listdir(imgs_dir)
list_path = os.path.join("charger", "charger_list.txt")
for img_name in imgs_list:
    img_path = f"val/{img_name}"
    with open(list_path, "a+") as f:
        f.write(img_path+"\n")
        